<% title "Главная страница" %>

<div id="conteiner">
    <div id="left">
        <div id="leftCont">
        		<%= link_to "Редактировать новости", admin_posts_path if logged_in? %><br/>
        		<%#= link_to image_tag("ico_rss.gif", :alt=>"rss"), formatted_posts_url(:rss), :class=>"rss" %>
        		<h2>НОВОСТИ</h2>
            <% @posts.each do |p| %>
		          <div class="indexNewsBlock">
		          	<div class="date"><%= p.created_at.strftime("%d.%m.%Y")%></div>
		              <div class="title"><%= link_to p.title, post_path(p) %></div>
		              <%= text_teaser(p.content, 250) %>
		          </div>
            <% end %>
        </div>
    </div>
</div>

<div id="right">
		<%= render :partial=>"includes/currency" %>
		
    <%= render :partial=>"includes/banners" %>
</div>

<% content_for :crediting do %>
	<div id="flash_block" class="flash">
    	<a href="http://www.adobe.com/go/getflashplayer">
				<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
			</a>
  </div>
  <%= render :partial=>"includes/notice" %>
	<div class="mainServices">
  	<h2><%= link_to_function image_tag("blank.gif", :alt=>"ипотечное кредитование", :title=>"ипотечное кредитование"), "show_form('order_form_mortgage')", :class=>"mortgageCrediting" %></h2>
   	<h2><%= link_to_function image_tag("blank.gif", :alt=>"авто кредитование", :title=>"авто кредитование"), "show_form('order_form_auto')", :class=>"autoCrediting" %>	</h2>
   	<h2><%= link_to_function image_tag("blank.gif", :alt=>"кредит под залог", :title=>"кредит под залог"), "show_form('order_form_bail')", :class=>"creditInSecurity" %>	</h2>
  </div>
<% end %>

<% content_for :footer do %>
	<%= render :partial=>"includes/order_form", :locals=>{:form_id=>"order_form_mortgage", :form_title=>"Ипотечное кредитирование", :order_type_id=>3} %>
	<%= render :partial=>"includes/order_form", :locals=>{:form_id=>"order_form_auto", :form_title=>"Авто кредитирование", :order_type_id=>1} %>
	<%= render :partial=>"includes/order_form", :locals=>{:form_id=>"order_form_bail", :form_title=>"Кредит под залог ", :order_type_id=>2} %>
<% end %>
<% javascript "swfobject" %>
<script type="text/javascript" charset="utf-8">
	var flashvars = {};
	var params = { quality: "best", wmode: "opaque" };
	var attributes = { classid:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" };
	swfobject.embedSWF("/swf/index.swf", "flash_block", "940", "200", "9.0.0", false, flashvars, params, attributes);
</script>
